<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let i = 0;
        let sum = 0;
        for(i=0;i<101;i=i+2){
            console.log(i);
            sum += i;
        }
        console.log("sum:"+sum);
        console.log("循环结束");
        i=0;
        sum = 0;
        while(i<101)
        {
            console.log(i);
            sum += i;
            i += 2;
        }
        console.log("sum:"+sum);
        console.log("循环结束");
    </script>
</html>